export function sortParams(obj:any):string {
    function sortKeys(obj:any):any {
      if (Array.isArray(obj)) {
        return obj.map(item => sortKeys(item)).sort();
      } else if (typeof obj === 'object' && obj !== null) {
        const sortedObj:{[key:string]:any} = {};
        Object.keys(obj).sort().forEach(key => {
          if(typeof obj[key] !== 'undefined'){
            sortedObj[key] = sortKeys(obj[key]);
          }
        });
        return sortedObj;
      }
      return obj;
    }
  
    const sortedObj:{[key:string]:any} = sortKeys(obj);
    return Object.keys(sortedObj).map(key => {
      if(['[object Object]', '[object Array]'].includes(Object.prototype.toString.call(sortedObj[key]))){
        return `${key}=${JSON.stringify(sortedObj[key])}`
      }else{
        return `${key}=${sortedObj[key]}`
      }
    }).join('&');
  }
  
  // 是否文件
  export function isFileOrBlob(value:any):boolean {
    return value instanceof File || value instanceof Blob;
  }